home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Auge 4000 / Auge 4000 #04 (1987)(Amiga User Gruppe Einzugsgebiet 4000).zip / Auge 4000 #04 (1987)(Amiga User Gruppe Einzugsgebiet 4000).adf / Quellen / digi.asm < prev    next >
Assembly Source File  |  1999-12-31  |  6KB  |  179 lines

  1. timerlo    equ       $bfd400
  2. timerhi    equ       $bfd500
  3. inter      equ       $bfdd00
  4. control    equ       $bfde00
  5. base1      equ       $BFE001
  6. base2      equ       $BFD000
  7. dra2       equ       base2+$000
  8. drb1       equ       base1+$100
  9. ddra2      equ       base2+$200
  10. ddrb1      equ       base1+$300
  11.            CMPI.L    #10,D0
  12.            BNE       Abort
  13.            JSR       _WERTE
  14.            MOVE.L    #$7FC00,D7
  15.            SUB.L     D6,D7
  16.            SUB.L     D6,D7
  17.            movea.l   D7,A0
  18.            move.l    D6,d0
  19. lop1:      clr.w     (a0)+         ; Speicher
  20.            dbra      d0,lop1       ; loeschen
  21. wa1:       andi.b    #64,$bfe001   ;auf Mausdruck
  22.            bne.s     wa1           ;warten
  23.            movea.l   4,a6          ; Supervisor-Modus
  24.            lea.l     super,a5
  25.            jmp       -30(a6)
  26. super:     move.l    D7,buffer
  27.            move.w    #$2700,SR          ; Interrupts sperren
  28.            move.b    #%00000000,ddrb1   ; Parallel-Port
  29.            move.b    ddra2,d0           ; initialisieren
  30.            andi.b    #%11111010,d0
  31.            ori.b     #%00000100,d0
  32.            move.b    d0,ddra2
  33.            move.b    D4,timerlo
  34.            move.b    #0,timerhi
  35.            move.b    #%01111110,inter
  36.            move.b    #%10000001,inter
  37.            move.b    #%10010101,control
  38.            move.l    buffer,$dff0a0     ; Soundparameter
  39.            move.w    #64,$dff0a8        ; setzen
  40.            move.w    D2,$dff0a6
  41.            move.w    D6,$dff0a4
  42.            move.l    buffer,$dff0b0
  43.            move.w    #64,$dff0b8
  44.            move.w    D2,$dff0b6
  45.            move.w    D6,$dff0b4
  46.            move.w    #$8003,$dff096
  47.            lea.l     block,a1           ; Farbdefinitionen
  48.            move.w    #$0000,block
  49.            move.w    #$0080,block+238
  50.            move.w    #$0090,block+240
  51.            move.w    #$00a0,block+242
  52.            move.w    #$00b0,block+244
  53.            move.w    #$00c0,block+246
  54.            move.w    #$00d0,block+248
  55.            move.w    #$00e0,block+250
  56.            move.w    #$00f0,block+252
  57.            move.w    #$0f00,block+254
  58.            move.w    #$0f00,block+256
  59. schleife:  movea.l   D7,a0
  60.            move.l    D5,d3
  61. schleife1: andi.b    #%00000001,inter
  62.            beq.S     schleife1
  63.            ori.b     #%00000100,dra2      ; Digitalisierung
  64.            andi.b    #%11111011,dra2      ; starten
  65. busy:      andi.b    #%00000001,dra2      ; Noch beschäftigt?
  66.            beq.S     busy           ; Ja,warten
  67.            clr.l     d1
  68.            move.b    drb1,d1        ; Sounddaten holen
  69.            eori.b    #128,d1        ; Umrechnung
  70.            move.b    d1,(a0)+       ; Wert speichern
  71.            asl.w     #1,d1          ; Farbe berechnen
  72.            move.w    0(a1,d1),$DFF180
  73.            subq.l    #1,d3
  74.            bpl.S     schleife1
  75.            andi.b    #64,$bfe001    ; Linke Maustaste...
  76.            bne.S     schleife       ; ...nicht gedrÜckt
  77.            movea.l   D7,a0
  78.            move.l    D5,d3
  79. w1:        move.w    #$0bb0,$dff180
  80.            andi.b    #128,$bfe001
  81.            beq.s     speichern
  82.            andi.b    #64,$bfe001
  83.            beq.s     w1
  84. schleife2: move.w    #$00bb,$dff180
  85.            andi.b    #%00000001,inter
  86.            beq.S     schleife2
  87.            ori.b     #%00000100,dra2      ; Digitalisierung
  88.            andi.b    #%11111011,dra2      ; starten
  89. busy2:     move.w    #$0b0b,$dff180
  90.            andi.b    #%00000001,dra2      ; Noch beschäftigt?
  91.            beq.S     busy2                ; Ja,warten
  92.            clr.l     d1          
  93.            move.b    drb1,d1              ; Sounddaten holen
  94.            eori.b    #128,d1              ; Umrechnung
  95.            cmpi.b    #0,d1
  96.            beq.s     schleife2
  97.            move.b    d1,(a0)+             ; Wert speichern
  98.            asl.w     #1,d1                ; Farbe berechnen
  99.            move.w    0(a1,d1),$DFF180
  100.            subq.l    #1,d3
  101.            bra       schleife1
  102. speichern: move.w    #0,SR                ;Interrupts zulassen
  103.            movea.l   4,a6
  104.            movea.l   #DOS_Name,a1
  105.            clr.l     d0
  106.            jsr       -552(a6)
  107.            movea.l   d0,a6
  108.            tst.l     d0
  109.            beq.s     Abort
  110.            jsr       -60(a6)
  111.            move.l    d0,d1
  112.            beq.s     Abort
  113.            move.l    D7,d2
  114.            move.l    D5,d3
  115.            jsr       -48(a6)
  116.            clr.l     d0
  117. Abort:     rts
  118. _WERTE:    MOVE.B    (A0)+,D1   ;1.Zeichen in D1 lesen
  119.            SUB.B     #48,D1     ;48 subtrahieren
  120.            EXT.W     D1
  121.            MULU      #100,D1    ;mit 100 multiplizieren
  122.            MOVE.L    D1,D2      ;D1 nach D2 transportieren
  123.  
  124.            MOVE.B    (A0)+,D1   ;2.Zeichen in D1 lesen
  125.            SUB.B     #48,D1     ;48 subtrahieren
  126.            EXT.W     D1
  127.            MULU      #10,D1     ;mit 10 multiplizieren
  128.            ADD.L     D1,D2      ;D2=D2+D1
  129.  
  130.            MOVE.B    (A0)+,D1   ;3.Zeichen in D1 lesen
  131.            SUB.B     #48,D1     ;48 subtrahieren
  132.            EXT.W     D1
  133.            EXT.L     D1
  134.            ADD.L     D1,D2      ;D2=D2+D1
  135.  
  136.            MOVE.B    (A0)+,D1   ;FREIZEICHEN UEBERLESEN
  137.            MOVE.L    D2,D4      ;D2=SPEED
  138.            DIVU      #5,D4      ;D4=SPEED/5
  139. ; JETZT DEN WERT FÜR DIE LAENGE !!!
  140.            MOVE.B    (A0)+,D1   ;1.ZEICHEN LESEN
  141.            SUB.B     #48,D1
  142.            EXT.W     D1
  143.            MULU      #20000,D1  ;MAL 20000,IN WOERTEN
  144.            MOVE.L    D1,D5      ;IN D5 SPEICHERN
  145.  
  146.            MOVE.B    (A0)+,D1   ;2.ZEICHEN LESEN
  147.            SUB.B     #48,D1
  148.            EXT.W     D1
  149.            MULU      #2000,D1
  150.            ADD.L     D1,D5      ;D5=D5+D1
  151.  
  152.            MOVE.B    (A0)+,D1   ;3.ZEICHEN LESEN
  153.            SUB.B     #48,D1
  154.            EXT.W     D1
  155.            MULU      #200,D1
  156.            ADD.L     D1,D5
  157.  
  158.            MOVE.B    (A0)+,D1   ;4.ZEICHEN LESEN
  159.            SUB.B     #48,D1
  160.            EXT.W     D1
  161.            MULU      #20,D1
  162.            ADD.L     D1,D5
  163.  
  164.            MOVE.B    (A0)+,D1   ;5.ZEICHEN LESEN
  165.            SUB.B     #48,D1
  166.            EXT.W     D1
  167.            MULU      #2,D1
  168.            ADD.L     D1,D5      ;LAENGE IN D5 !!
  169.  
  170.            MOVE.L    D5,D6
  171.            DIVU      #2,D6      ;LAENGE/2 IN D6!!
  172.            RTS
  173.  
  174.            DATA
  175. buffer:    dc.l      0
  176. block:     dcb.w     256,10
  177. DOS_Name:  dc.b      'dos.library',0
  178.  
  179.